﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using RZD_maps.Modules.Stations.Views;
using RZD_maps.Infrastructure;
using Microsoft.Practices.Prism.Events;
using RZD_maps.Modules.Stations.Model;

namespace RZD_maps.Modules.Stations.ViewModels
{
    public class ViewModel
    {

        private IEventAggregator eventAggregator;
        private StationModel model;


        public ViewModel(IEventAggregator eventAggregator)
        {
            model = new StationModel();
            this.eventAggregator = eventAggregator;
            model.viewModel = this;
        }

        public void TransferMapPosition(double lng, double lat, int zoom)
        {
            MapPositionItem item = new MapPositionItem();
            item.lng = lng;
            item.lat = lat;
            item.zoom = zoom;
            eventAggregator.GetEvent<MapPositionItemEvent>().Publish(item);
        }

        public void TransferGraphicInfo(string data)
        {
            InfoForGraphics item = new InfoForGraphics();
            item.name = data;
            eventAggregator.GetEvent<InfoForGraphicsEvent>().Publish(item);
        }


        private StationsView _view;

        public StationsView View
        {
            get
            {
                return _view;
            }
            set
            {
                _view = value;
            }
        }
    }
}
